/*********************************************************************************************
 *
 *						function to check number is valid or not 							 *
 *
 ********************************************************************************************/

#include "mystrings.h"

int valid_no(char *line){		/* procdure to validate number */
	int isDigit  = 0;
	int count  ;
	int flag = 0;
	int is10Digit = 0;	

	char  *ptr, *q = NULL;

	count = 0;

//	line[mystrlen(line)-1] ='\0' ;
//	printf (" line = %s \n",line);
	for (ptr = line ;*ptr== ' '|| *ptr =='\t'  ;ptr++ )
		;
	if (*ptr == '+' || *ptr == '-')
		q=ptr++;
	
	q = ptr;

	while (*ptr){
		if ( *ptr >= '0' && *ptr <= '9')
			count++;
		else 
			flag = 1;
		ptr++;
	}

	if ( count <= 10 && flag ==0){
			if (is_int(q) == 1)
				return 1;
			else
				return 0;
	}
	else 
		return 0;


}


